import { createApp } from "vue";
import App from "./App.vue";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import "./main.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

import { createRouter, createWebHistory } from "vue-router";
import guide from "./pages/guide.vue";
import module from "./pages/module.vue";
import dataFile from "./pages/dataFile.vue";
import home from "./pages/home.vue";
import personalGuide from "./pages/personalGuide.vue";
import profile from "./pages/profile.vue";
import resources from "./pages/resources.vue";
import studyNotes from "./pages/studyNotes.vue";
// 组件

const routes = [
  //定义对应的组件
  { path: "/", component: home },
  { path: "/guide", component: guide },
  { path: "/module", component: module },
  { path: "/dataFile", component: dataFile },
  { path: "/personalGuide", component: personalGuide },
  { path: "/profile", component: profile },
  { path: "/resources", component: resources },
  { path: "/studyNotes", component: studyNotes },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

const app = createApp(App);
// element引入
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.use(ElementPlus);
app.use(router);
app.mount("#app");
